Flutter Navigator RouteTransitionRecord
The RouteTransitionRecord
class in Flutter is an abstract class that acts as a wrapper for a Route
object, primarily used in conjunction with TransitionDelegate
to manage and control how routes transition onto or off the screen in a Navigator
.
Core Properties and Functions
-
route
: This getter retrieves the underlyingRoute
object that is wrapped by theRouteTransitionRecord
. -
isWaitingForEnteringDecision
:- This boolean property indicates whether the route is awaiting a decision on how it should transition onto the screen.
- If
true
, it means that an explicit decision is required, usually made in theTransitionDelegate.resolve
method.
-
isWaitingForExitingDecision
:- Similar to
isWaitingForEnteringDecision
, this property indicates whether the route is waiting for a decision on how it should transition off the screen.
- Similar to
Transition Decision Methods
-
markForPush()
:- This method is used to mark the route for a push operation with an animated transition.
- It should be called during the
TransitionDelegate.resolve
process for entering routes that are waiting for a decision.
-
markForAdd()
:- This method marks the route to be added to the
Navigator
without an animated transition. - It's used for entering routes during the
TransitionDelegate.resolve
process.
- This method marks the route to be added to the
-
markForPop(result)
:- Used for exiting routes, this method marks the route to be popped off the
Navigator
with an animated transition. - An optional result can be passed.
- Used for exiting routes, this method marks the route to be popped off the
-
markForComplete(result)
:- This method is for exiting routes to indicate that they should be completed with the provided result and removed from the
Navigator
without an animated transition.
- This method is for exiting routes to indicate that they should be completed with the provided result and removed from the
-
markForRemove()
:- This is used to mark an exiting route to be removed from the
Navigator
without completing and without an animated transition.
- This is used to mark an exiting route to be removed from the
本文作者:Maeiee
本文链接:Flutter Navigator RouteTransitionRecord
版权声明:如无特别声明,本文即为原创文章,版权归 Maeiee 所有,未经允许不得转载!
喜欢我文章的朋友请随缘打赏,鼓励我创作更多更好的作品!